package com.joven.internet.controller;

import com.joven.core.constant.ResultInfo;
import com.joven.core.model.User;
import com.joven.internet.client.JovenServiceClient;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author joven_wong
 * 2021/10/18 16:37
 */
@RestController
@RequestMapping("/feign")
@RequiredArgsConstructor
public class TestJovenController {

    private final JovenServiceClient jovenServiceClient;

    @GetMapping("/show")
    public ResultInfo<User> showUser(@RequestParam("id") Long id) {
        return jovenServiceClient.getUser(id);
    }
}

